package spaceinvaders;

import java.awt.Image;

public class Sprite {

	private boolean isVisible;
	private Image image;
	protected Image origImage;
	protected int x;
	protected int y;
	protected int dx;
	protected int explosionDelay;
    protected boolean dead;

	public Sprite() {
		isVisible = true;
		explosionDelay=6;
	}

	public void die() {
		isVisible = false;
	}

	public boolean isVisible() {
		return isVisible;
	}

	protected void setVisible(boolean visible) {
		this.isVisible = visible;
	}

	public void setImage(Image image) {
		this.image = image;
	}

	public Image getImage() {
		return image;
	}

	public void setX(int x) {
		this.x = x;
	}

	public void setY(int y) {
		this.y = y;
	}
	
	public int getY() {
		return y;
	}

	public int getX() {
		return x;
	}

    public void setDead(boolean dead) {
        this.dead = dead;
    }

    public boolean isDead() {
        return this.dead;
    }
    
    public void resetImage() {
    	this.image = this.origImage;
    }
	
	public void resetExplosionDelay() {
		explosionDelay=0;
	}
	
	public void incrementExplosionDelay() {
		explosionDelay++;
	}
	
	public int getExplosionDelay() {
		return explosionDelay;
	}
}